﻿@using Inovout.Descriptor
@model IEnumerable<KuaJing.Tasks.Domain.Task>

<div class="iui-panel">
    <h1>任务查询</h1>
    <div class="row form-inline">
        @using (Html.BeginForm())
            {
            <div class="col-md-10">
                @Html.Query()
            </div>
            <div class="col-md-2">
                @Html.Submit("查询", new { @class = "btn btn-default btn-primary" })
            </div>
        }
    </div>
</div>
<div class="iui-panel iui-panel-table">
    <h1>
        任务列表
        <span class="ico-add">
            @Html.ActionLink("新建任务", "New", new { ReturnUrl = this.Request.Url })
            @if (Model.Any())
            {
                @Html.ActionLink("发磅邮件", "SendMail", QueryCriteriaHelper.BuildRouteDictionary(Html.ViewData.GetQueryCriteria(Model), new RouteValueDictionary()))
            }
        </span>
    </h1>
    <div>
        @Html.Partial("Table")


        @*@Html.Table(() => "没有任务数据" + Html.ActionLink("立即新建", "New", new { ReturnUrl = Request.Url })).Build(properties =>
            {
                properties.Add(m => m.Name);
                properties.Add(m => m.Assignee);
                properties.Add(m => m.Participants);
                properties.Add(m => m.ExpectedStartDate);
                properties.Add(m => m.ExpectedEndDate);
                properties.Add(m => m.ActualStartDate);
                properties.Add(m => m.ActualEndDate);
                properties.Add(m => m.Status).RenderAs(v => v.ToAlias());
                properties.Extend("操作", v => Html.ActionLink("编辑", "Edit", new { Id = v.Id, ReturnUrl = Request.Url }), v => Html.ActionLink("删除", "Delete", new { Id = v.Id, ReturnUrl = Request.Url }));
            })*@
    </div>
</div>
